/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
"use strict";

var EXPORTED_SYMBOLS = ["convertQTKeyCode"];


/**
 * convert a QT keyCode to a DOM keyCode.
 * It returns an object {keyCode:x, charCode:x}. Values can be 0 if there
 * are no correspondance. The object can also contain a "modifier" property
 * indicating modifiers (ALT, SHIFT...)
 */
function convertQTKeyCode(QTKeyCode){

    var k = "k"+QTKeyCode.toString(16);
    if (k in QtKeys) {
        return QtKeys[k];
    }
    else if (QTKeyCode >= 0x61 && QTKeyCode <= 0x7c) {
        return {keyCode:QTKeyCode - 0x20, charCode:QTKeyCode}
    }
    else if (QTKeyCode >= 0x20 && QTKeyCode <= 0xff) {
        return {keyCode:0, charCode:QTKeyCode}
    }
    else
        return {keyCode:0, charCode:0}
}

const wu = Components.interfaces.nsIDOMWindowUtils;
const c = Components.interfaces.nsIDOMKeyEvent;

var QtKeys = {
/*Qt::Key_Escape*/                 'k1000000':    {keyCode:c.DOM_VK_ESCAPE,         charCode:0}, 
/*Qt::Key_Tab*/                    'k1000001':    {keyCode:c.DOM_VK_TAB,            charCode:0}, 
/*Qt::Key_Backtab*/                'k1000002':    {keyCode:c.DOM_VK_TAB,            charCode:0, modifier:wu.MODIFIER_SHIFT}, 
/*Qt::Key_Backspace*/              'k1000003':    {keyCode:c.DOM_VK_BACK_SPACE,     charCode:0}, 
/*Qt::Key_Return*/                 'k1000004':    {keyCode:c.DOM_VK_RETURN,         charCode:0}, 
/*Qt::Key_Enter*/                  'k1000005':    {keyCode:c.DOM_VK_ENTER,          charCode:0}, 
/*Qt::Key_Insert*/                 'k1000006':    {keyCode:c.DOM_VK_INSERT,         charCode:0}, 
/*Qt::Key_Delete*/                 'k1000007':    {keyCode:c.DOM_VK_DELETE,         charCode:0}, 
/*Qt::Key_Pause*/                  'k1000008':    {keyCode:c.DOM_VK_PAUSE,          charCode:0}, 
/*Qt::Key_Print*/                  'k1000009':    {keyCode:c.DOM_VK_PRINTSCREEN,    charCode:0}, 
/*Qt::Key_SysReq*/                 'k100000a':    {keyCode:c.DOM_VK_PRINTSCREEN,    charCode:0, modifier:wu.MODIFIER_SHIFT}, 
/*Qt::Key_Clear*/                  'k100000b':    {keyCode:c.DOM_VK_CLEAR,          charCode:0}, 
/*Qt::Key_Home*/                   'k1000010':    {keyCode:c.DOM_VK_HOME,           charCode:0}, 
/*Qt::Key_End*/                    'k1000011':    {keyCode:c.DOM_VK_END,            charCode:0}, 
/*Qt::Key_Left*/                   'k1000012':    {keyCode:c.DOM_VK_LEFT,           charCode:0}, 
/*Qt::Key_Up*/                     'k1000013':    {keyCode:c.DOM_VK_UP,             charCode:0}, 
/*Qt::Key_Right*/                  'k1000014':    {keyCode:c.DOM_VK_RIGHT,          charCode:0}, 
/*Qt::Key_Down*/                   'k1000015':    {keyCode:c.DOM_VK_DOWN,           charCode:0}, 
/*Qt::Key_PageUp*/                 'k1000016':    {keyCode:c.DOM_VK_PAGE_UP,        charCode:0}, 
/*Qt::Key_PageDown*/               'k1000017':    {keyCode:c.DOM_VK_PAGE_DOWN,      charCode:0}, 
/*Qt::Key_Shift*/                  'k1000020':    {keyCode:c.DOM_VK_SHIFT,          charCode:0}, 
/*Qt::Key_Control*/                'k1000021':    {keyCode:c.DOM_VK_CONTROL,        charCode:0}, 
/*Qt::Key_Meta*/                   'k1000022':    {keyCode:c.DOM_VK_META,           charCode:0}, 
/*Qt::Key_Alt*/                    'k1000023':    {keyCode:c.DOM_VK_ALT,            charCode:0}, 
/*Qt::Key_AltGr*/                  'k1001103':    {keyCode:c.DOM_VK_ALTGR,          charCode:0}, 
/*Qt::Key_CapsLock*/               'k1000024':    {keyCode:c.DOM_VK_CAPS_LOCK,      charCode:0}, 
/*Qt::Key_NumLock*/                'k1000025':    {keyCode:c.DOM_VK_NUM_LOCK,       charCode:0}, 
/*Qt::Key_ScrollLock*/             'k1000026':    {keyCode:c.DOM_VK_SCROLL_LOCK,    charCode:0}, 
/*Qt::Key_F1*/                     'k1000030':    {keyCode:c.DOM_VK_F1,             charCode:0}, 
/*Qt::Key_F2*/                     'k1000031':    {keyCode:c.DOM_VK_F2,             charCode:0}, 
/*Qt::Key_F3*/                     'k1000032':    {keyCode:c.DOM_VK_F3,             charCode:0}, 
/*Qt::Key_F4*/                     'k1000033':    {keyCode:c.DOM_VK_F4,             charCode:0}, 
/*Qt::Key_F5*/                     'k1000034':    {keyCode:c.DOM_VK_F5,             charCode:0}, 
/*Qt::Key_F6*/                     'k1000035':    {keyCode:c.DOM_VK_F6,             charCode:0}, 
/*Qt::Key_F7*/                     'k1000036':    {keyCode:c.DOM_VK_F7,             charCode:0}, 
/*Qt::Key_F8*/                     'k1000037':    {keyCode:c.DOM_VK_F8,             charCode:0}, 
/*Qt::Key_F9*/                     'k1000038':    {keyCode:c.DOM_VK_F9,             charCode:0}, 
/*Qt::Key_F10*/                    'k1000039':    {keyCode:c.DOM_VK_F10,            charCode:0}, 
/*Qt::Key_F11*/                    'k100003a':    {keyCode:c.DOM_VK_F11,            charCode:0}, 
/*Qt::Key_F12*/                    'k100003b':    {keyCode:c.DOM_VK_F12,            charCode:0}, 
/*Qt::Key_F13*/                    'k100003c':    {keyCode:c.DOM_VK_F13,            charCode:0}, 
/*Qt::Key_F14*/                    'k100003d':    {keyCode:c.DOM_VK_F14,            charCode:0}, 
/*Qt::Key_F15*/                    'k100003e':    {keyCode:c.DOM_VK_F15,            charCode:0}, 
/*Qt::Key_F16*/                    'k100003f':    {keyCode:c.DOM_VK_F16,            charCode:0}, 
/*Qt::Key_F17*/                    'k1000040':    {keyCode:c.DOM_VK_F17,            charCode:0}, 
/*Qt::Key_F18*/                    'k1000041':    {keyCode:c.DOM_VK_F18,            charCode:0}, 
/*Qt::Key_F19*/                    'k1000042':    {keyCode:c.DOM_VK_F19,            charCode:0}, 
/*Qt::Key_F20*/                    'k1000043':    {keyCode:c.DOM_VK_F20,            charCode:0}, 
/*Qt::Key_F21*/                    'k1000044':    {keyCode:c.DOM_VK_F21,            charCode:0}, 
/*Qt::Key_F22*/                    'k1000045':    {keyCode:c.DOM_VK_F22,            charCode:0}, 
/*Qt::Key_F23*/                    'k1000046':    {keyCode:c.DOM_VK_F23,            charCode:0}, 
/*Qt::Key_F24*/                    'k1000047':    {keyCode:c.DOM_VK_F24,            charCode:0}, 
/*Qt::Key_F25*/                    'k1000048':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F26*/                    'k1000049':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F27*/                    'k100004a':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F28*/                    'k100004b':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F29*/                    'k100004c':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F30*/                    'k100004d':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F31*/                    'k100004e':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F32*/                    'k100004f':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F33*/                    'k1000050':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F34*/                    'k1000051':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_F35*/                    'k1000052':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Super_L*/                'k1000053':    {keyCode:c.DOM_VK_WIN,            charCode:0}, 
/*Qt::Key_Super_R*/                'k1000054':    {keyCode:c.DOM_VK_WIN,            charCode:0}, 
/*Qt::Key_Menu*/                   'k1000055':    {keyCode:c.DOM_CONTEXT_MENU,      charCode:0}, 
/*Qt::Key_Hyper_L*/                'k1000056':    {keyCode:c.DOM_VK_WIN,            charCode:0}, 
/*Qt::Key_Hyper_R*/                'k1000057':    {keyCode:c.DOM_VK_WIN,            charCode:0}, 
/*Qt::Key_Help*/                   'k1000058':    {keyCode:c.DOM_VK_HELP,           charCode:0}, 
/*Qt::Key_Direction_L*/            'k1000059':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Direction_R*/            'k1000060':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Space*/                  'k20':         {keyCode:c.DOM_VK_SPACE,          charCode:0x20}, 
/*Qt::Key_Exclam*/                 'k21':         {keyCode:c.DOM_VK_EXCLAMATION,    charCode:0x21}, 
/*Qt::Key_QuoteDbl*/               'k22':         {keyCode:c.DOM_VK_DOUBLE_QUOTE,   charCode:0x22}, 
/*Qt::Key_NumberSign*/             'k23':         {keyCode:c.DOM_VK_HASH,           charCode:0x23}, 
/*Qt::Key_Dollar*/                 'k24':         {keyCode:c.DOM_VK_DOLLAR,         charCode:0x24}, 
/*Qt::Key_Percent*/                'k25':         {keyCode:c.DOM_VK_PERCENT,        charCode:0x25}, 
/*Qt::Key_Ampersand*/              'k26':         {keyCode:c.DOM_VK_AMPERSAND,      charCode:0x26}, 
/*Qt::Key_Apostrophe*/             'k27':         {keyCode:c.DOM_VK_QUOTE,          charCode:0x27}, 
/*Qt::Key_ParenLeft*/              'k28':         {keyCode:c.DOM_VK_OPEN_PAREN,     charCode:0x28}, 
/*Qt::Key_ParenRight*/             'k29':         {keyCode:c.DOM_VK_CLOSE_PAREN,    charCode:0x29}, 
/*Qt::Key_Asterisk*/               'k2a':         {keyCode:c.DOM_VK_ASTERISK,       charCode:0x2a}, 
/*Qt::Key_Plus*/                   'k2b':         {keyCode:c.DOM_VK_PLUS,           charCode:0x2b}, 
/*Qt::Key_Comma*/                  'k2c':         {keyCode:c.DOM_VK_COMMA,          charCode:0x2c}, 
/*Qt::Key_Minus*/                  'k2d':         {keyCode:c.DOM_VK_HYPHEN_MINUS,   charCode:0x2d}, 
/*Qt::Key_Period*/                 'k2e':         {keyCode:c.DOM_VK_PERIOD,         charCode:0x2e}, 
/*Qt::Key_Slash*/                  'k2f':         {keyCode:c.DOM_VK_SLASH,          charCode:0x2f}, 
/*Qt::Key_0*/                      'k30':         {keyCode:c.DOM_VK_0,              charCode:0x30}, 
/*Qt::Key_1*/                      'k31':         {keyCode:c.DOM_VK_1,              charCode:0x31}, 
/*Qt::Key_2*/                      'k32':         {keyCode:c.DOM_VK_2,              charCode:0x32}, 
/*Qt::Key_3*/                      'k33':         {keyCode:c.DOM_VK_3,              charCode:0x33}, 
/*Qt::Key_4*/                      'k34':         {keyCode:c.DOM_VK_4,              charCode:0x34}, 
/*Qt::Key_5*/                      'k35':         {keyCode:c.DOM_VK_5,              charCode:0x35}, 
/*Qt::Key_6*/                      'k36':         {keyCode:c.DOM_VK_6,              charCode:0x36}, 
/*Qt::Key_7*/                      'k37':         {keyCode:c.DOM_VK_7,              charCode:0x37}, 
/*Qt::Key_8*/                      'k38':         {keyCode:c.DOM_VK_8,              charCode:0x38}, 
/*Qt::Key_9*/                      'k39':         {keyCode:c.DOM_VK_9,              charCode:0x39}, 
/*Qt::Key_Colon*/                  'k3a':         {keyCode:c.DOM_VK_COLON,          charCode:0x3a}, 
/*Qt::Key_Semicolon*/              'k3b':         {keyCode:c.DOM_VK_SEMICOLON,      charCode:0x3b}, 
/*Qt::Key_Less*/                   'k3c':         {keyCode:c.DOM_VK_LESS_THAN,      charCode:0x3c}, 
/*Qt::Key_Equal*/                  'k3d':         {keyCode:c.DOM_VK_EQUALS,         charCode:0x3d}, 
/*Qt::Key_Greater*/                'k3e':         {keyCode:c.DOM_VK_GREATER_THAN,   charCode:0x3e}, 
/*Qt::Key_Question*/               'k3f':         {keyCode:c.DOM_VK_QUESTION_MARK,  charCode:0x3f}, 
/*Qt::Key_At*/                     'k40':         {keyCode:c.DOM_VK_AT,             charCode:0x40}, 
/*Qt::Key_A*/                      'k41':         {keyCode:c.DOM_VK_A,              charCode:0x41}, 
/*Qt::Key_B*/                      'k42':         {keyCode:c.DOM_VK_B,              charCode:0x42}, 
/*Qt::Key_C*/                      'k43':         {keyCode:c.DOM_VK_C,              charCode:0x43}, 
/*Qt::Key_D*/                      'k44':         {keyCode:c.DOM_VK_D,              charCode:0x44}, 
/*Qt::Key_E*/                      'k45':         {keyCode:c.DOM_VK_E,              charCode:0x45}, 
/*Qt::Key_F*/                      'k46':         {keyCode:c.DOM_VK_F,              charCode:0x46}, 
/*Qt::Key_G*/                      'k47':         {keyCode:c.DOM_VK_G,              charCode:0x47}, 
/*Qt::Key_H*/                      'k48':         {keyCode:c.DOM_VK_H,              charCode:0x48}, 
/*Qt::Key_I*/                      'k49':         {keyCode:c.DOM_VK_I,              charCode:0x49}, 
/*Qt::Key_J*/                      'k4a':         {keyCode:c.DOM_VK_J,              charCode:0x4a}, 
/*Qt::Key_K*/                      'k4b':         {keyCode:c.DOM_VK_K,              charCode:0x4b}, 
/*Qt::Key_L*/                      'k4c':         {keyCode:c.DOM_VK_L,              charCode:0x4c}, 
/*Qt::Key_M*/                      'k4d':         {keyCode:c.DOM_VK_M,              charCode:0x4d}, 
/*Qt::Key_N*/                      'k4e':         {keyCode:c.DOM_VK_N,              charCode:0x4e}, 
/*Qt::Key_O*/                      'k4f':         {keyCode:c.DOM_VK_O,              charCode:0x4f}, 
/*Qt::Key_P*/                      'k50':         {keyCode:c.DOM_VK_P,              charCode:0x50}, 
/*Qt::Key_Q*/                      'k51':         {keyCode:c.DOM_VK_Q,              charCode:0x51}, 
/*Qt::Key_R*/                      'k52':         {keyCode:c.DOM_VK_R,              charCode:0x52}, 
/*Qt::Key_S*/                      'k53':         {keyCode:c.DOM_VK_S,              charCode:0x53}, 
/*Qt::Key_T*/                      'k54':         {keyCode:c.DOM_VK_T,              charCode:0x54}, 
/*Qt::Key_U*/                      'k55':         {keyCode:c.DOM_VK_U,              charCode:0x55}, 
/*Qt::Key_V*/                      'k56':         {keyCode:c.DOM_VK_V,              charCode:0x56}, 
/*Qt::Key_W*/                      'k57':         {keyCode:c.DOM_VK_W,              charCode:0x57}, 
/*Qt::Key_X*/                      'k58':         {keyCode:c.DOM_VK_X,              charCode:0x58}, 
/*Qt::Key_Y*/                      'k59':         {keyCode:c.DOM_VK_Y,              charCode:0x59}, 
/*Qt::Key_Z*/                      'k5a':         {keyCode:c.DOM_VK_Z,              charCode:0x5a}, 
/*Qt::Key_BracketLeft*/            'k5b':         {keyCode:c.DOM_VK_OPEN_BRACKET,   charCode:0x5b}, 
/*Qt::Key_Backslash*/              'k5c':         {keyCode:c.DOM_VK_BACK_SLASH,     charCode:0x5c}, 
/*Qt::Key_BracketRight*/           'k5d':         {keyCode:c.DOM_VK_CLOSE_BRACKET,  charCode:0x5d}, 
/*Qt::Key_AsciiCircum*/            'k5e':         {keyCode:c.DOM_VK_CIRCUMFLEX,     charCode:0x5e}, 
/*Qt::Key_Underscore*/             'k5f':         {keyCode:c.DOM_VK_UNDERSCORE,     charCode:0x5f}, 
/*Qt::Key_QuoteLeft*/              'k60':         {keyCode:c.DOM_VK_BACK_QUOTE,     charCode:0x60}, 
/*Qt::Key_BraceLeft*/              'k7b':         {keyCode:c.DOM_VK_OPEN_CURLY_BRACKET,charCode:0x7b}, 
/*Qt::Key_Bar*/                    'k7c':         {keyCode:c.DOM_VK_PIPE,           charCode:0x7c}, 
/*Qt::Key_BraceRight*/             'k7d':         {keyCode:c.DOM_VK_CLOSE_CURLY_BRACKET,charCode:0x7d},
/*Qt::Key_AsciiTilde*/             'k7e':         {keyCode:c.DOM_VK_TILDE,          charCode:0x7e}, 
/*Qt::Key_nobreakspace*/           'ka0':         {keyCode:0,                       charCode:0xa0}, 
/*Qt::Key_exclamdown*/             'ka1':         {keyCode:0,                       charCode:0xa1}, 
/*Qt::Key_cent*/                   'ka2':         {keyCode:0,                       charCode:0xa2}, 
/*Qt::Key_sterling*/               'ka3':         {keyCode:0,                       charCode:0xa3}, 
/*Qt::Key_currency*/               'ka4':         {keyCode:0,                       charCode:0xa4}, 
/*Qt::Key_yen*/                    'ka5':         {keyCode:0,                       charCode:0xa5}, 
/*Qt::Key_brokenbar*/              'ka6':         {keyCode:0,                       charCode:0xa6}, 
/*Qt::Key_section*/                'ka7':         {keyCode:0,                       charCode:0xa7}, 
/*Qt::Key_diaeresis*/              'ka8':         {keyCode:0,                       charCode:0xa8}, 
/*Qt::Key_copyright*/              'ka9':         {keyCode:0,                       charCode:0xa9}, 
/*Qt::Key_ordfeminine*/            'kaa':         {keyCode:0,                       charCode:0xaa}, 
/*Qt::Key_guillemotleft*/          'kab':         {keyCode:0,                       charCode:0xab}, 
/*Qt::Key_notsign*/                'kac':         {keyCode:0,                       charCode:0xac}, 
/*Qt::Key_hyphen*/                 'kad':         {keyCode:0,                       charCode:0xad}, 
/*Qt::Key_registered*/             'kae':         {keyCode:0,                       charCode:0xae}, 
/*Qt::Key_macron*/                 'kaf':         {keyCode:0,                       charCode:0xaf}, 
/*Qt::Key_degree*/                 'kb0':         {keyCode:0,                       charCode:0xb0}, 
/*Qt::Key_plusminus*/              'kb1':         {keyCode:0,                       charCode:0xb1}, 
/*Qt::Key_twosuperior*/            'kb2':         {keyCode:0,                       charCode:0xb2}, 
/*Qt::Key_threesuperior*/          'kb3':         {keyCode:0,                       charCode:0xb3}, 
/*Qt::Key_acute*/                  'kb4':         {keyCode:0,                       charCode:0xb4}, 
/*Qt::Key_mu*/                     'kb5':         {keyCode:0,                       charCode:0xb5}, 
/*Qt::Key_paragraph*/              'kb6':         {keyCode:0,                       charCode:0xb6}, 
/*Qt::Key_periodcentered*/         'kb7':         {keyCode:0,                       charCode:0xb7}, 
/*Qt::Key_cedilla*/                'kb8':         {keyCode:0,                       charCode:0xb8}, 
/*Qt::Key_onesuperior*/            'kb9':         {keyCode:0,                       charCode:0xb9}, 
/*Qt::Key_masculine*/              'kba':         {keyCode:0,                       charCode:0xba}, 
/*Qt::Key_guillemotright*/         'kbb':         {keyCode:0,                       charCode:0xbb}, 
/*Qt::Key_onequarter*/             'kbc':         {keyCode:0,                       charCode:0xbc}, 
/*Qt::Key_onehalf*/                'kbd':         {keyCode:0,                       charCode:0xbd}, 
/*Qt::Key_threequarters*/          'kbe':         {keyCode:0,                       charCode:0xbe}, 
/*Qt::Key_questiondown*/           'kbf':         {keyCode:0,                       charCode:0xbf}, 
/*Qt::Key_Agrave*/                 'kc0':         {keyCode:0,                       charCode:0xc0}, 
/*Qt::Key_Aacute*/                 'kc1':         {keyCode:0,                       charCode:0xc1}, 
/*Qt::Key_Acircumflex*/            'kc2':         {keyCode:0,                       charCode:0xc2}, 
/*Qt::Key_Atilde*/                 'kc3':         {keyCode:0,                       charCode:0xc3}, 
/*Qt::Key_Adiaeresis*/             'kc4':         {keyCode:0,                       charCode:0xc4}, 
/*Qt::Key_Aring*/                  'kc5':         {keyCode:0,                       charCode:0xc5}, 
/*Qt::Key_AE*/                     'kc6':         {keyCode:0,                       charCode:0xc6}, 
/*Qt::Key_Ccedilla*/               'kc7':         {keyCode:0,                       charCode:0xc7}, 
/*Qt::Key_Egrave*/                 'kc8':         {keyCode:0,                       charCode:0xc8}, 
/*Qt::Key_Eacute*/                 'kc9':         {keyCode:0,                       charCode:0xc9}, 
/*Qt::Key_Ecircumflex*/            'kca':         {keyCode:0,                       charCode:0xca}, 
/*Qt::Key_Ediaeresis*/             'kcb':         {keyCode:0,                       charCode:0xcb}, 
/*Qt::Key_Igrave*/                 'kcc':         {keyCode:0,                       charCode:0xcc}, 
/*Qt::Key_Iacute*/                 'kcd':         {keyCode:0,                       charCode:0xcd}, 
/*Qt::Key_Icircumflex*/            'kce':         {keyCode:0,                       charCode:0xce}, 
/*Qt::Key_Idiaeresis*/             'kcf':         {keyCode:0,                       charCode:0xcf}, 
/*Qt::Key_ETH*/                    'kd0':         {keyCode:0,                       charCode:0xd0}, 
/*Qt::Key_Ntilde*/                 'kd1':         {keyCode:0,                       charCode:0xd1}, 
/*Qt::Key_Ograve*/                 'kd2':         {keyCode:0,                       charCode:0xd2}, 
/*Qt::Key_Oacute*/                 'kd3':         {keyCode:0,                       charCode:0xd3}, 
/*Qt::Key_Ocircumflex*/            'kd4':         {keyCode:0,                       charCode:0xd4}, 
/*Qt::Key_Otilde*/                 'kd5':         {keyCode:0,                       charCode:0xd5}, 
/*Qt::Key_Odiaeresis*/             'kd6':         {keyCode:0,                       charCode:0xd6}, 
/*Qt::Key_multiply*/               'kd7':         {keyCode:0,                       charCode:0xd7}, 
/*Qt::Key_Ooblique*/               'kd8':         {keyCode:0,                       charCode:0xd8}, 
/*Qt::Key_Ugrave*/                 'kd9':         {keyCode:0,                       charCode:0xd9}, 
/*Qt::Key_Uacute*/                 'kda':         {keyCode:0,                       charCode:0xda}, 
/*Qt::Key_Ucircumflex*/            'kdb':         {keyCode:0,                       charCode:0xdb}, 
/*Qt::Key_Udiaeresis*/             'kdc':         {keyCode:0,                       charCode:0xdc}, 
/*Qt::Key_Yacute*/                 'kdd':         {keyCode:0,                       charCode:0xdd}, 
/*Qt::Key_THORN*/                  'kde':         {keyCode:0,                       charCode:0xde}, 
/*Qt::Key_ssharp*/                 'kdf':         {keyCode:0,                       charCode:0xdf}, 
/*Qt::Key_division*/               'kf7':         {keyCode:0,                       charCode:0xf7}, 
/*Qt::Key_ydiaeresis*/             'kff':         {keyCode:0,                       charCode:0xff}, 
/*Qt::Key_Multi_key*/              'k1001120':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Codeinput*/              'k1001137':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_SingleCandidate*/        'k100113c':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MultipleCandidate*/      'k100113d':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_PreviousCandidate*/      'k100113e':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Mode_switch*/            'k100117e':    {keyCode:c.DOM_VK_MODECHANGE,     charCode:0}, 
/*Qt::Key_Kanji*/                  'k1001121':    {keyCode:c.DOM_VK_KANJI,          charCode:0}, 
/*Qt::Key_Muhenkan*/               'k1001122':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Henkan*/                 'k1001123':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Romaji*/                 'k1001124':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hiragana*/               'k1001125':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Katakana*/               'k1001126':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hiragana_Katakana*/      'k1001127':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Zenkaku*/                'k1001128':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hankaku*/                'k1001129':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Zenkaku_Hankaku*/        'k100112a':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Touroku*/                'k100112b':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Massyo*/                 'k100112c':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Kana_Lock*/              'k100112d':    {keyCode:c.DOM_VK_KANA,           charCode:0}, 
/*Qt::Key_Kana_Shift*/             'k100112e':    {keyCode:c.DOM_VK_KANA,           charCode:0}, 
/*Qt::Key_Eisu_Shift*/             'k100112f':    {keyCode:c.DOM_VK_EISU,           charCode:0}, 
/*Qt::Key_Eisu_toggle*/            'k1001130':    {keyCode:c.DOM_VK_EISU,           charCode:0}, 
/*Qt::Key_Hangul*/                 'k1001131':    {keyCode:c.DOM_VK_HANGUL,         charCode:0}, 
/*Qt::Key_Hangul_Start*/           'k1001132':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hangul_End*/             'k1001133':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hangul_Hanja*/           'k1001134':    {keyCode:c.DOM_VK_HANJA,          charCode:0}, 
/*Qt::Key_Hangul_Jamo*/            'k1001135':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hangul_Romaja*/          'k1001136':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hangul_Jeonja*/          'k1001138':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hangul_Banja*/           'k1001139':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hangul_PreHanja*/        'k100113a':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hangul_PostHanja*/       'k100113b':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hangul_Special*/         'k100113f':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Grave*/             'k1001250':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Acute*/             'k1001251':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Circumflex*/        'k1001252':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Tilde*/             'k1001253':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Macron*/            'k1001254':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Breve*/             'k1001255':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Abovedot*/          'k1001256':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Diaeresis*/         'k1001257':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Abovering*/         'k1001258':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Doubleacute*/       'k1001259':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Caron*/             'k100125a':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Cedilla*/           'k100125b':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Ogonek*/            'k100125c':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Iota*/              'k100125d':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Voiced_Sound*/      'k100125e':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Semivoiced_Sound*/  'k100125f':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Belowdot*/          'k1001260':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Hook*/              'k1001261':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Dead_Horn*/              'k1001262':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Back*/                   'k1000061':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Forward*/                'k1000062':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Stop*/                   'k1000063':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Refresh*/                'k1000064':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_VolumeDown*/             'k1000070':    {keyCode:c.DOM_VK_VOLUME_DOWN,    charCode:0}, 
/*Qt::Key_VolumeMute*/             'k1000071':    {keyCode:c.DOM_VK_VOLUME_MUTE,    charCode:0}, 
/*Qt::Key_VolumeUp*/               'k1000072':    {keyCode:c.DOM_VK_VOLUME_UP,      charCode:0}, 
/*Qt::Key_BassBoost*/              'k1000073':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_BassUp*/                 'k1000074':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_BassDown*/               'k1000075':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_TrebleUp*/               'k1000076':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_TrebleDown*/             'k1000077':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MediaPlay*/              'k1000080':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MediaStop*/              'k1000081':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MediaPrevious*/          'k1000082':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MediaNext*/              'k1000083':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MediaRecord*/            'k1000084':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MediaPause*/             'k1000085':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MediaTogglePlayPause*/   'k1000086':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_HomePage*/               'k1000090':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Favorites*/              'k1000091':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Search*/                 'k1000092':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Standby*/                'k1000093':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_OpenUrl*/                'k1000094':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchMail*/             'k10000a0':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchMedia*/            'k10000a1':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch0*/                'k10000a2':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch1*/                'k10000a3':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch2*/                'k10000a4':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch3*/                'k10000a5':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch4*/                'k10000a6':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch5*/                'k10000a7':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch6*/                'k10000a8':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch7*/                'k10000a9':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch8*/                'k10000aa':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Launch9*/                'k10000ab':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchA*/                'k10000ac':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchB*/                'k10000ad':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchC*/                'k10000ae':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchD*/                'k10000af':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchE*/                'k10000b0':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchF*/                'k10000b1':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchG*/                'k100010e':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LaunchH*/                'k100010f':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MonBrightnessUp*/        'k10000b2':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MonBrightnessDown*/      'k10000b3':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_KeyboardLightOnOff*/     'k10000b4':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_KeyboardBrightnessUp*/   'k10000b5':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_KeyboardBrightnessDown*/ 'k10000b6':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_PowerOff*/               'k10000b7':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_WakeUp*/                 'k10000b8':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Eject*/                  'k10000b9':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_ScreenSaver*/            'k10000ba':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_WWW*/                    'k10000bb':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Memo*/                   'k10000bc':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LightBulb*/              'k10000bd':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Shop*/                   'k10000be':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_History*/                'k10000bf':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_AddFavorite*/            'k10000c0':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_HotLinks*/               'k10000c1':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_BrightnessAdjust*/       'k10000c2':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Finance*/                'k10000c3':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Community*/              'k10000c4':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_AudioRewind*/            'k10000c5':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_BackForward*/            'k10000c6':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_ApplicationLeft*/        'k10000c7':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_ApplicationRight*/       'k10000c8':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Book*/                   'k10000c9':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_CD*/                     'k10000ca':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Calculator*/             'k10000cb':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_ToDoList*/               'k10000cc':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_ClearGrab*/              'k10000cd':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Close*/                  'k10000ce':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Copy*/                   'k10000cf':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Cut*/                    'k10000d0':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Display*/                'k10000d1':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_DOS*/                    'k10000d2':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Documents*/              'k10000d3':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Excel*/                  'k10000d4':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Explorer*/               'k10000d5':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Game*/                   'k10000d6':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Go*/                     'k10000d7':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_iTouch*/                 'k10000d8':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LogOff*/                 'k10000d9':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Market*/                 'k10000da':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Meeting*/                'k10000db':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MenuKB*/                 'k10000dc':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MenuPB*/                 'k10000dd':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MySites*/                'k10000de':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_News*/                   'k10000df':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_OfficeHome*/             'k10000e0':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Option*/                 'k10000e1':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Paste*/                  'k10000e2':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Phone*/                  'k10000e3':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Calendar*/               'k10000e4':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Reply*/                  'k10000e5':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Reload*/                 'k10000e6':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_RotateWindows*/          'k10000e7':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_RotationPB*/             'k10000e8':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_RotationKB*/             'k10000e9':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Save*/                   'k10000ea':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Send*/                   'k10000eb':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Spell*/                  'k10000ec':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_SplitScreen*/            'k10000ed':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Support*/                'k10000ee':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_TaskPane*/               'k10000ef':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Terminal*/               'k10000f0':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Tools*/                  'k10000f1':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Travel*/                 'k10000f2':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Video*/                  'k10000f3':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Word*/                   'k10000f4':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Xfer*/                   'k10000f5':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_ZoomIn*/                 'k10000f6':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_ZoomOut*/                'k10000f7':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Away*/                   'k10000f8':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Messenger*/              'k10000f9':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_WebCam*/                 'k10000fa':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MailForward*/            'k10000fb':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Pictures*/               'k10000fc':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Music*/                  'k10000fd':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Battery*/                'k10000fe':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Bluetooth*/              'k10000ff':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_WLAN*/                   'k1000100':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_UWB*/                    'k1000101':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_AudioForward*/           'k1000102':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_AudioRepeat*/            'k1000103':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_AudioRandomPlay*/        'k1000104':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Subtitle*/               'k1000105':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_AudioCycleTrack*/        'k1000106':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Time*/                   'k1000107':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hibernate*/              'k1000108':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_View*/                   'k1000109':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_TopMenu*/                'k100010a':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_PowerDown*/              'k100010b':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Suspend*/                'k100010c':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_ContrastAdjust*/         'k100010d':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_MediaLast*/              'k100ffff':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_unknown*/                'k1ffffff':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Call*/                   'k1100004':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Camera*/                 'k1100020':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_CameraFocus*/            'k1100021':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Context1*/               'k1100000':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Context2*/               'k1100001':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Context3*/               'k1100002':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Context4*/               'k1100003':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Flip*/                   'k1100006':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Hangup*/                 'k1100005':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_No*/                     'k1010002':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Select*/                 'k1010000':    {keyCode:c.DOM_VK_SELECT,         charCode:0}, 
/*Qt::Key_Yes*/                    'k1010001':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_ToggleCallHangup*/       'k1100007':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_VoiceDial*/              'k1100008':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_LastNumberRedial*/       'k1100009':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Execute*/                'k1020003':    {keyCode:c.DOM_VK_EXECUTE,        charCode:0}, 
/*Qt::Key_Printer*/                'k1020002':    {keyCode:c.DOM_VK_PRINT,          charCode:0}, 
/*Qt::Key_Play*/                   'k1020005':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Sleep*/                  'k1020004':    {keyCode:c.DOM_VK_SLEEP,          charCode:0}, 
/*Qt::Key_Zoom*/                   'k1020006':    {keyCode:0,                       charCode:0}, 
/*Qt::Key_Cancel*/                 'k1020001':    {keyCode:c.DOM_VK_CANCEL,         charCode:0}, 
}
